<%@ Import namespace="SubversionReports.Entities"%>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PathsView.ascx.cs" Inherits="SubversionReports.Web.Controls.PathsView" %>

<%@ Register TagPrefix="uc" TagName="RecordLinks" Src="~/Controls/RecordLinks.ascx" %>
<%@ Register TagPrefix="uc" TagName="FileView" Src="~/Controls/FileView.ascx" %>


<asp:PlaceHolder runat="server" ID="PathsViewPlaceHolder">
    <uc:RecordLinks runat="server" ID="RecordLinks1" RecordIdentifier="RevisionId" />

    <asp:Image runat="server" ID="RevisionAuthorIcon" />
    <h2>Revision: <asp:Literal runat="server" ID="RevisionId" /></h2>
    <h3><asp:Literal runat="server" ID="RevisionDate" /></h3>
    <p>
        <strong><asp:Literal runat="server" ID="RevisionAuthor" />:</strong>
        <em><asp:Literal runat="server" ID="RevisionComment" /></em>
    </p>
    <div class="clearing"></div>
    <asp:Repeater runat="server" ID="PathRepeater">
        <HeaderTemplate><ul></HeaderTemplate>
        <ItemTemplate>
            <li style='list-style-image: url(<%# GetChangeIcon((PathRevisionType)DataBinder.Eval(Container.DataItem, "RevisionType")) %>); list-style-position: inside;'>
                <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RevisionType") %>' />
                <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RevisionPath") %>' NavigateUrl='<%# string.Format("{0}?RevisionId={1}&Path={2}&Author={3}", Request.FilePath, RevisionId.Text, DataBinder.Eval(Container.DataItem, "RevisionPath"), RevisionAuthor.Text) %>' />
                <asp:HyperLink ID="HyperLink2" runat="server" Text="Diff" NavigateUrl='<%# string.Format("{0}?RevisionId={1}&CompareTo={2}&Path={3}&Author={4}", Request.FilePath, RevisionId.Text, (int.Parse(RevisionId.Text) - 1), DataBinder.Eval(Container.DataItem, "RevisionPath"), RevisionAuthor.Text) %>' Visible='<%# DataBinder.Eval(Container.DataItem, "RevisionType").ToString().Equals("Modified") %>' />
                <%--<asp:Literal runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ChangeDescription") %>' />--%>
            </li>
        </ItemTemplate>
        <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
</asp:PlaceHolder>

<asp:PlaceHolder runat="server" ID="FileViewPlaceHolder">
    <uc:FileView runat="server" ID="FileView1" />
</asp:PlaceHolder>